Left Termination of the query pattern goal_in_3(g, a, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

goal(A, B, C) :- ','(s2t(A, T), tapplast(T, B, C)).
tapplast(L, X, Last) :- ','(tappend(L, node(nil, X, nil), LX), tlast(Last, LX)).
tlast(X, node(nil, X, nil)).
tlast(X, node(L, H, R)) :- tlast(X, L).
tlast(X, node(L, H, R)) :- tlast(X, R).
tappend(nil, T, T).
tappend(node(nil, X, T2), T1, node(T1, X, T2)).
tappend(node(T1, X, nil), T2, node(T1, X, T2)).
tappend(node(T1, X, T2), T3, node(U, X, T2)) :- tappend(T1, T3, U).
tappend(node(T1, X, T2), T3, node(T1, X, U)) :- tappend(T2, T3, U).
s2t(s(X), node(T, Y, T)) :- s2t(X, T).
s2t(s(X), node(nil, Y, T)) :- s2t(X, T).
s2t(s(X), node(T, Y, nil)) :- s2t(X, T).
s2t(s(X), node(nil, Y, nil)).
s2t(0, nil).

Queries:

goal(g,a,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

goal_in(A, B, C) → U1(A, B, C, s2t_in(A, T))
s2t_in(0, nil) → s2t_out(0, nil)
s2t_in(s(X), node(nil, Y, nil)) → s2t_out(s(X), node(nil, Y, nil))
s2t_in(s(X), node(T, Y, nil)) → U11(X, T, Y, s2t_in(X, T))
s2t_in(s(X), node(nil, Y, T)) → U10(X, Y, T, s2t_in(X, T))
s2t_in(s(X), node(T, Y, T)) → U9(X, T, Y, s2t_in(X, T))
U9(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, T))
U10(X, Y, T, s2t_out(X, T)) → s2t_out(s(X), node(nil, Y, T))
U11(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, nil))
U1(A, B, C, s2t_out(A, T)) → U2(A, B, C, tapplast_in(T, B, C))
tapplast_in(L, X, Last) → U3(L, X, Last, tappend_in(L, node(nil, X, nil), LX))
tappend_in(node(T1, X, T2), T3, node(T1, X, U)) → U8(T1, X, T2, T3, U, tappend_in(T2, T3, U))
tappend_in(node(T1, X, T2), T3, node(U, X, T2)) → U7(T1, X, T2, T3, U, tappend_in(T1, T3, U))
tappend_in(node(T1, X, nil), T2, node(T1, X, T2)) → tappend_out(node(T1, X, nil), T2, node(T1, X, T2))
tappend_in(node(nil, X, T2), T1, node(T1, X, T2)) → tappend_out(node(nil, X, T2), T1, node(T1, X, T2))
tappend_in(nil, T, T) → tappend_out(nil, T, T)
U7(T1, X, T2, T3, U, tappend_out(T1, T3, U)) → tappend_out(node(T1, X, T2), T3, node(U, X, T2))
U8(T1, X, T2, T3, U, tappend_out(T2, T3, U)) → tappend_out(node(T1, X, T2), T3, node(T1, X, U))
U3(L, X, Last, tappend_out(L, node(nil, X, nil), LX)) → U4(L, X, Last, tlast_in(Last, LX))
tlast_in(X, node(L, H, R)) → U6(X, L, H, R, tlast_in(X, R))
tlast_in(X, node(L, H, R)) → U5(X, L, H, R, tlast_in(X, L))
tlast_in(X, node(nil, X, nil)) → tlast_out(X, node(nil, X, nil))
U5(X, L, H, R, tlast_out(X, L)) → tlast_out(X, node(L, H, R))
U6(X, L, H, R, tlast_out(X, R)) → tlast_out(X, node(L, H, R))
U4(L, X, Last, tlast_out(Last, LX)) → tapplast_out(L, X, Last)
U2(A, B, C, tapplast_out(T, B, C)) → goal_out(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in(x1, x2, x3)  =  goal_in(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
s2t_in(x1, x2)  =  s2t_in(x1)
0  =  0
nil  =  nil
s2t_out(x1, x2)  =  s2t_out(x2)
s(x1)  =  s(x1)
node(x1, x2, x3)  =  node(x1, x3)
U11(x1, x2, x3, x4)  =  U11(x4)
U10(x1, x2, x3, x4)  =  U10(x4)
U9(x1, x2, x3, x4)  =  U9(x4)
U2(x1, x2, x3, x4)  =  U2(x4)
tapplast_in(x1, x2, x3)  =  tapplast_in(x1)
U3(x1, x2, x3, x4)  =  U3(x4)
tappend_in(x1, x2, x3)  =  tappend_in(x1, x2)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x3, x6)
tappend_out(x1, x2, x3)  =  tappend_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
tlast_in(x1, x2)  =  tlast_in(x2)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
tlast_out(x1, x2)  =  tlast_out
tapplast_out(x1, x2, x3)  =  tapplast_out
goal_out(x1, x2, x3)  =  goal_out

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

goal_in(A, B, C) → U1(A, B, C, s2t_in(A, T))
s2t_in(0, nil) → s2t_out(0, nil)
s2t_in(s(X), node(nil, Y, nil)) → s2t_out(s(X), node(nil, Y, nil))
s2t_in(s(X), node(T, Y, nil)) → U11(X, T, Y, s2t_in(X, T))
s2t_in(s(X), node(nil, Y, T)) → U10(X, Y, T, s2t_in(X, T))
s2t_in(s(X), node(T, Y, T)) → U9(X, T, Y, s2t_in(X, T))
U9(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, T))
U10(X, Y, T, s2t_out(X, T)) → s2t_out(s(X), node(nil, Y, T))
U11(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, nil))
U1(A, B, C, s2t_out(A, T)) → U2(A, B, C, tapplast_in(T, B, C))
tapplast_in(L, X, Last) → U3(L, X, Last, tappend_in(L, node(nil, X, nil), LX))
tappend_in(node(T1, X, T2), T3, node(T1, X, U)) → U8(T1, X, T2, T3, U, tappend_in(T2, T3, U))
tappend_in(node(T1, X, T2), T3, node(U, X, T2)) → U7(T1, X, T2, T3, U, tappend_in(T1, T3, U))
tappend_in(node(T1, X, nil), T2, node(T1, X, T2)) → tappend_out(node(T1, X, nil), T2, node(T1, X, T2))
tappend_in(node(nil, X, T2), T1, node(T1, X, T2)) → tappend_out(node(nil, X, T2), T1, node(T1, X, T2))
tappend_in(nil, T, T) → tappend_out(nil, T, T)
U7(T1, X, T2, T3, U, tappend_out(T1, T3, U)) → tappend_out(node(T1, X, T2), T3, node(U, X, T2))
U8(T1, X, T2, T3, U, tappend_out(T2, T3, U)) → tappend_out(node(T1, X, T2), T3, node(T1, X, U))
U3(L, X, Last, tappend_out(L, node(nil, X, nil), LX)) → U4(L, X, Last, tlast_in(Last, LX))
tlast_in(X, node(L, H, R)) → U6(X, L, H, R, tlast_in(X, R))
tlast_in(X, node(L, H, R)) → U5(X, L, H, R, tlast_in(X, L))
tlast_in(X, node(nil, X, nil)) → tlast_out(X, node(nil, X, nil))
U5(X, L, H, R, tlast_out(X, L)) → tlast_out(X, node(L, H, R))
U6(X, L, H, R, tlast_out(X, R)) → tlast_out(X, node(L, H, R))
U4(L, X, Last, tlast_out(Last, LX)) → tapplast_out(L, X, Last)
U2(A, B, C, tapplast_out(T, B, C)) → goal_out(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in(x1, x2, x3)  =  goal_in(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
s2t_in(x1, x2)  =  s2t_in(x1)
0  =  0
nil  =  nil
s2t_out(x1, x2)  =  s2t_out(x2)
s(x1)  =  s(x1)
node(x1, x2, x3)  =  node(x1, x3)
U11(x1, x2, x3, x4)  =  U11(x4)
U10(x1, x2, x3, x4)  =  U10(x4)
U9(x1, x2, x3, x4)  =  U9(x4)
U2(x1, x2, x3, x4)  =  U2(x4)
tapplast_in(x1, x2, x3)  =  tapplast_in(x1)
U3(x1, x2, x3, x4)  =  U3(x4)
tappend_in(x1, x2, x3)  =  tappend_in(x1, x2)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x3, x6)
tappend_out(x1, x2, x3)  =  tappend_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
tlast_in(x1, x2)  =  tlast_in(x2)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
tlast_out(x1, x2)  =  tlast_out
tapplast_out(x1, x2, x3)  =  tapplast_out
goal_out(x1, x2, x3)  =  goal_out


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

GOAL_IN(A, B, C) → U11(A, B, C, s2t_in(A, T))
GOAL_IN(A, B, C) → S2T_IN(A, T)
S2T_IN(s(X), node(T, Y, nil)) → U111(X, T, Y, s2t_in(X, T))
S2T_IN(s(X), node(T, Y, nil)) → S2T_IN(X, T)
S2T_IN(s(X), node(nil, Y, T)) → U101(X, Y, T, s2t_in(X, T))
S2T_IN(s(X), node(nil, Y, T)) → S2T_IN(X, T)
S2T_IN(s(X), node(T, Y, T)) → U91(X, T, Y, s2t_in(X, T))
S2T_IN(s(X), node(T, Y, T)) → S2T_IN(X, T)
U11(A, B, C, s2t_out(A, T)) → U21(A, B, C, tapplast_in(T, B, C))
U11(A, B, C, s2t_out(A, T)) → TAPPLAST_IN(T, B, C)
TAPPLAST_IN(L, X, Last) → U31(L, X, Last, tappend_in(L, node(nil, X, nil), LX))
TAPPLAST_IN(L, X, Last) → TAPPEND_IN(L, node(nil, X, nil), LX)
TAPPEND_IN(node(T1, X, T2), T3, node(T1, X, U)) → U81(T1, X, T2, T3, U, tappend_in(T2, T3, U))
TAPPEND_IN(node(T1, X, T2), T3, node(T1, X, U)) → TAPPEND_IN(T2, T3, U)
TAPPEND_IN(node(T1, X, T2), T3, node(U, X, T2)) → U71(T1, X, T2, T3, U, tappend_in(T1, T3, U))
TAPPEND_IN(node(T1, X, T2), T3, node(U, X, T2)) → TAPPEND_IN(T1, T3, U)
U31(L, X, Last, tappend_out(L, node(nil, X, nil), LX)) → U41(L, X, Last, tlast_in(Last, LX))
U31(L, X, Last, tappend_out(L, node(nil, X, nil), LX)) → TLAST_IN(Last, LX)
TLAST_IN(X, node(L, H, R)) → U61(X, L, H, R, tlast_in(X, R))
TLAST_IN(X, node(L, H, R)) → TLAST_IN(X, R)
TLAST_IN(X, node(L, H, R)) → U51(X, L, H, R, tlast_in(X, L))
TLAST_IN(X, node(L, H, R)) → TLAST_IN(X, L)

The TRS R consists of the following rules:

goal_in(A, B, C) → U1(A, B, C, s2t_in(A, T))
s2t_in(0, nil) → s2t_out(0, nil)
s2t_in(s(X), node(nil, Y, nil)) → s2t_out(s(X), node(nil, Y, nil))
s2t_in(s(X), node(T, Y, nil)) → U11(X, T, Y, s2t_in(X, T))
s2t_in(s(X), node(nil, Y, T)) → U10(X, Y, T, s2t_in(X, T))
s2t_in(s(X), node(T, Y, T)) → U9(X, T, Y, s2t_in(X, T))
U9(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, T))
U10(X, Y, T, s2t_out(X, T)) → s2t_out(s(X), node(nil, Y, T))
U11(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, nil))
U1(A, B, C, s2t_out(A, T)) → U2(A, B, C, tapplast_in(T, B, C))
tapplast_in(L, X, Last) → U3(L, X, Last, tappend_in(L, node(nil, X, nil), LX))
tappend_in(node(T1, X, T2), T3, node(T1, X, U)) → U8(T1, X, T2, T3, U, tappend_in(T2, T3, U))
tappend_in(node(T1, X, T2), T3, node(U, X, T2)) → U7(T1, X, T2, T3, U, tappend_in(T1, T3, U))
tappend_in(node(T1, X, nil), T2, node(T1, X, T2)) → tappend_out(node(T1, X, nil), T2, node(T1, X, T2))
tappend_in(node(nil, X, T2), T1, node(T1, X, T2)) → tappend_out(node(nil, X, T2), T1, node(T1, X, T2))
tappend_in(nil, T, T) → tappend_out(nil, T, T)
U7(T1, X, T2, T3, U, tappend_out(T1, T3, U)) → tappend_out(node(T1, X, T2), T3, node(U, X, T2))
U8(T1, X, T2, T3, U, tappend_out(T2, T3, U)) → tappend_out(node(T1, X, T2), T3, node(T1, X, U))
U3(L, X, Last, tappend_out(L, node(nil, X, nil), LX)) → U4(L, X, Last, tlast_in(Last, LX))
tlast_in(X, node(L, H, R)) → U6(X, L, H, R, tlast_in(X, R))
tlast_in(X, node(L, H, R)) → U5(X, L, H, R, tlast_in(X, L))
tlast_in(X, node(nil, X, nil)) → tlast_out(X, node(nil, X, nil))
U5(X, L, H, R, tlast_out(X, L)) → tlast_out(X, node(L, H, R))
U6(X, L, H, R, tlast_out(X, R)) → tlast_out(X, node(L, H, R))
U4(L, X, Last, tlast_out(Last, LX)) → tapplast_out(L, X, Last)
U2(A, B, C, tapplast_out(T, B, C)) → goal_out(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in(x1, x2, x3)  =  goal_in(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
s2t_in(x1, x2)  =  s2t_in(x1)
0  =  0
nil  =  nil
s2t_out(x1, x2)  =  s2t_out(x2)
s(x1)  =  s(x1)
node(x1, x2, x3)  =  node(x1, x3)
U11(x1, x2, x3, x4)  =  U11(x4)
U10(x1, x2, x3, x4)  =  U10(x4)
U9(x1, x2, x3, x4)  =  U9(x4)
U2(x1, x2, x3, x4)  =  U2(x4)
tapplast_in(x1, x2, x3)  =  tapplast_in(x1)
U3(x1, x2, x3, x4)  =  U3(x4)
tappend_in(x1, x2, x3)  =  tappend_in(x1, x2)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x3, x6)
tappend_out(x1, x2, x3)  =  tappend_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
tlast_in(x1, x2)  =  tlast_in(x2)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
tlast_out(x1, x2)  =  tlast_out
tapplast_out(x1, x2, x3)  =  tapplast_out
goal_out(x1, x2, x3)  =  goal_out
U101(x1, x2, x3, x4)  =  U101(x4)
TAPPEND_IN(x1, x2, x3)  =  TAPPEND_IN(x1, x2)
U41(x1, x2, x3, x4)  =  U41(x4)
TLAST_IN(x1, x2)  =  TLAST_IN(x2)
U21(x1, x2, x3, x4)  =  U21(x4)
U81(x1, x2, x3, x4, x5, x6)  =  U81(x1, x6)
U61(x1, x2, x3, x4, x5)  =  U61(x5)
U71(x1, x2, x3, x4, x5, x6)  =  U71(x3, x6)
U51(x1, x2, x3, x4, x5)  =  U51(x5)
U31(x1, x2, x3, x4)  =  U31(x4)
U91(x1, x2, x3, x4)  =  U91(x4)
S2T_IN(x1, x2)  =  S2T_IN(x1)
GOAL_IN(x1, x2, x3)  =  GOAL_IN(x1)
TAPPLAST_IN(x1, x2, x3)  =  TAPPLAST_IN(x1)
U11(x1, x2, x3, x4)  =  U11(x4)
U111(x1, x2, x3, x4)  =  U111(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

GOAL_IN(A, B, C) → U11(A, B, C, s2t_in(A, T))
GOAL_IN(A, B, C) → S2T_IN(A, T)
S2T_IN(s(X), node(T, Y, nil)) → U111(X, T, Y, s2t_in(X, T))
S2T_IN(s(X), node(T, Y, nil)) → S2T_IN(X, T)
S2T_IN(s(X), node(nil, Y, T)) → U101(X, Y, T, s2t_in(X, T))
S2T_IN(s(X), node(nil, Y, T)) → S2T_IN(X, T)
S2T_IN(s(X), node(T, Y, T)) → U91(X, T, Y, s2t_in(X, T))
S2T_IN(s(X), node(T, Y, T)) → S2T_IN(X, T)
U11(A, B, C, s2t_out(A, T)) → U21(A, B, C, tapplast_in(T, B, C))
U11(A, B, C, s2t_out(A, T)) → TAPPLAST_IN(T, B, C)
TAPPLAST_IN(L, X, Last) → U31(L, X, Last, tappend_in(L, node(nil, X, nil), LX))
TAPPLAST_IN(L, X, Last) → TAPPEND_IN(L, node(nil, X, nil), LX)
TAPPEND_IN(node(T1, X, T2), T3, node(T1, X, U)) → U81(T1, X, T2, T3, U, tappend_in(T2, T3, U))
TAPPEND_IN(node(T1, X, T2), T3, node(T1, X, U)) → TAPPEND_IN(T2, T3, U)
TAPPEND_IN(node(T1, X, T2), T3, node(U, X, T2)) → U71(T1, X, T2, T3, U, tappend_in(T1, T3, U))
TAPPEND_IN(node(T1, X, T2), T3, node(U, X, T2)) → TAPPEND_IN(T1, T3, U)
U31(L, X, Last, tappend_out(L, node(nil, X, nil), LX)) → U41(L, X, Last, tlast_in(Last, LX))
U31(L, X, Last, tappend_out(L, node(nil, X, nil), LX)) → TLAST_IN(Last, LX)
TLAST_IN(X, node(L, H, R)) → U61(X, L, H, R, tlast_in(X, R))
TLAST_IN(X, node(L, H, R)) → TLAST_IN(X, R)
TLAST_IN(X, node(L, H, R)) → U51(X, L, H, R, tlast_in(X, L))
TLAST_IN(X, node(L, H, R)) → TLAST_IN(X, L)

The TRS R consists of the following rules:

goal_in(A, B, C) → U1(A, B, C, s2t_in(A, T))
s2t_in(0, nil) → s2t_out(0, nil)
s2t_in(s(X), node(nil, Y, nil)) → s2t_out(s(X), node(nil, Y, nil))
s2t_in(s(X), node(T, Y, nil)) → U11(X, T, Y, s2t_in(X, T))
s2t_in(s(X), node(nil, Y, T)) → U10(X, Y, T, s2t_in(X, T))
s2t_in(s(X), node(T, Y, T)) → U9(X, T, Y, s2t_in(X, T))
U9(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, T))
U10(X, Y, T, s2t_out(X, T)) → s2t_out(s(X), node(nil, Y, T))
U11(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, nil))
U1(A, B, C, s2t_out(A, T)) → U2(A, B, C, tapplast_in(T, B, C))
tapplast_in(L, X, Last) → U3(L, X, Last, tappend_in(L, node(nil, X, nil), LX))
tappend_in(node(T1, X, T2), T3, node(T1, X, U)) → U8(T1, X, T2, T3, U, tappend_in(T2, T3, U))
tappend_in(node(T1, X, T2), T3, node(U, X, T2)) → U7(T1, X, T2, T3, U, tappend_in(T1, T3, U))
tappend_in(node(T1, X, nil), T2, node(T1, X, T2)) → tappend_out(node(T1, X, nil), T2, node(T1, X, T2))
tappend_in(node(nil, X, T2), T1, node(T1, X, T2)) → tappend_out(node(nil, X, T2), T1, node(T1, X, T2))
tappend_in(nil, T, T) → tappend_out(nil, T, T)
U7(T1, X, T2, T3, U, tappend_out(T1, T3, U)) → tappend_out(node(T1, X, T2), T3, node(U, X, T2))
U8(T1, X, T2, T3, U, tappend_out(T2, T3, U)) → tappend_out(node(T1, X, T2), T3, node(T1, X, U))
U3(L, X, Last, tappend_out(L, node(nil, X, nil), LX)) → U4(L, X, Last, tlast_in(Last, LX))
tlast_in(X, node(L, H, R)) → U6(X, L, H, R, tlast_in(X, R))
tlast_in(X, node(L, H, R)) → U5(X, L, H, R, tlast_in(X, L))
tlast_in(X, node(nil, X, nil)) → tlast_out(X, node(nil, X, nil))
U5(X, L, H, R, tlast_out(X, L)) → tlast_out(X, node(L, H, R))
U6(X, L, H, R, tlast_out(X, R)) → tlast_out(X, node(L, H, R))
U4(L, X, Last, tlast_out(Last, LX)) → tapplast_out(L, X, Last)
U2(A, B, C, tapplast_out(T, B, C)) → goal_out(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in(x1, x2, x3)  =  goal_in(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
s2t_in(x1, x2)  =  s2t_in(x1)
0  =  0
nil  =  nil
s2t_out(x1, x2)  =  s2t_out(x2)
s(x1)  =  s(x1)
node(x1, x2, x3)  =  node(x1, x3)
U11(x1, x2, x3, x4)  =  U11(x4)
U10(x1, x2, x3, x4)  =  U10(x4)
U9(x1, x2, x3, x4)  =  U9(x4)
U2(x1, x2, x3, x4)  =  U2(x4)
tapplast_in(x1, x2, x3)  =  tapplast_in(x1)
U3(x1, x2, x3, x4)  =  U3(x4)
tappend_in(x1, x2, x3)  =  tappend_in(x1, x2)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x3, x6)
tappend_out(x1, x2, x3)  =  tappend_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
tlast_in(x1, x2)  =  tlast_in(x2)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
tlast_out(x1, x2)  =  tlast_out
tapplast_out(x1, x2, x3)  =  tapplast_out
goal_out(x1, x2, x3)  =  goal_out
U101(x1, x2, x3, x4)  =  U101(x4)
TAPPEND_IN(x1, x2, x3)  =  TAPPEND_IN(x1, x2)
U41(x1, x2, x3, x4)  =  U41(x4)
TLAST_IN(x1, x2)  =  TLAST_IN(x2)
U21(x1, x2, x3, x4)  =  U21(x4)
U81(x1, x2, x3, x4, x5, x6)  =  U81(x1, x6)
U61(x1, x2, x3, x4, x5)  =  U61(x5)
U71(x1, x2, x3, x4, x5, x6)  =  U71(x3, x6)
U51(x1, x2, x3, x4, x5)  =  U51(x5)
U31(x1, x2, x3, x4)  =  U31(x4)
U91(x1, x2, x3, x4)  =  U91(x4)
S2T_IN(x1, x2)  =  S2T_IN(x1)
GOAL_IN(x1, x2, x3)  =  GOAL_IN(x1)
TAPPLAST_IN(x1, x2, x3)  =  TAPPLAST_IN(x1)
U11(x1, x2, x3, x4)  =  U11(x4)
U111(x1, x2, x3, x4)  =  U111(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 15 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

TLAST_IN(X, node(L, H, R)) → TLAST_IN(X, L)
TLAST_IN(X, node(L, H, R)) → TLAST_IN(X, R)

The TRS R consists of the following rules:

goal_in(A, B, C) → U1(A, B, C, s2t_in(A, T))
s2t_in(0, nil) → s2t_out(0, nil)
s2t_in(s(X), node(nil, Y, nil)) → s2t_out(s(X), node(nil, Y, nil))
s2t_in(s(X), node(T, Y, nil)) → U11(X, T, Y, s2t_in(X, T))
s2t_in(s(X), node(nil, Y, T)) → U10(X, Y, T, s2t_in(X, T))
s2t_in(s(X), node(T, Y, T)) → U9(X, T, Y, s2t_in(X, T))
U9(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, T))
U10(X, Y, T, s2t_out(X, T)) → s2t_out(s(X), node(nil, Y, T))
U11(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, nil))
U1(A, B, C, s2t_out(A, T)) → U2(A, B, C, tapplast_in(T, B, C))
tapplast_in(L, X, Last) → U3(L, X, Last, tappend_in(L, node(nil, X, nil), LX))
tappend_in(node(T1, X, T2), T3, node(T1, X, U)) → U8(T1, X, T2, T3, U, tappend_in(T2, T3, U))
tappend_in(node(T1, X, T2), T3, node(U, X, T2)) → U7(T1, X, T2, T3, U, tappend_in(T1, T3, U))
tappend_in(node(T1, X, nil), T2, node(T1, X, T2)) → tappend_out(node(T1, X, nil), T2, node(T1, X, T2))
tappend_in(node(nil, X, T2), T1, node(T1, X, T2)) → tappend_out(node(nil, X, T2), T1, node(T1, X, T2))
tappend_in(nil, T, T) → tappend_out(nil, T, T)
U7(T1, X, T2, T3, U, tappend_out(T1, T3, U)) → tappend_out(node(T1, X, T2), T3, node(U, X, T2))
U8(T1, X, T2, T3, U, tappend_out(T2, T3, U)) → tappend_out(node(T1, X, T2), T3, node(T1, X, U))
U3(L, X, Last, tappend_out(L, node(nil, X, nil), LX)) → U4(L, X, Last, tlast_in(Last, LX))
tlast_in(X, node(L, H, R)) → U6(X, L, H, R, tlast_in(X, R))
tlast_in(X, node(L, H, R)) → U5(X, L, H, R, tlast_in(X, L))
tlast_in(X, node(nil, X, nil)) → tlast_out(X, node(nil, X, nil))
U5(X, L, H, R, tlast_out(X, L)) → tlast_out(X, node(L, H, R))
U6(X, L, H, R, tlast_out(X, R)) → tlast_out(X, node(L, H, R))
U4(L, X, Last, tlast_out(Last, LX)) → tapplast_out(L, X, Last)
U2(A, B, C, tapplast_out(T, B, C)) → goal_out(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in(x1, x2, x3)  =  goal_in(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
s2t_in(x1, x2)  =  s2t_in(x1)
0  =  0
nil  =  nil
s2t_out(x1, x2)  =  s2t_out(x2)
s(x1)  =  s(x1)
node(x1, x2, x3)  =  node(x1, x3)
U11(x1, x2, x3, x4)  =  U11(x4)
U10(x1, x2, x3, x4)  =  U10(x4)
U9(x1, x2, x3, x4)  =  U9(x4)
U2(x1, x2, x3, x4)  =  U2(x4)
tapplast_in(x1, x2, x3)  =  tapplast_in(x1)
U3(x1, x2, x3, x4)  =  U3(x4)
tappend_in(x1, x2, x3)  =  tappend_in(x1, x2)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x3, x6)
tappend_out(x1, x2, x3)  =  tappend_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
tlast_in(x1, x2)  =  tlast_in(x2)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
tlast_out(x1, x2)  =  tlast_out
tapplast_out(x1, x2, x3)  =  tapplast_out
goal_out(x1, x2, x3)  =  goal_out
TLAST_IN(x1, x2)  =  TLAST_IN(x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

TLAST_IN(X, node(L, H, R)) → TLAST_IN(X, L)
TLAST_IN(X, node(L, H, R)) → TLAST_IN(X, R)

R is empty.
The argument filtering Pi contains the following mapping:
node(x1, x2, x3)  =  node(x1, x3)
TLAST_IN(x1, x2)  =  TLAST_IN(x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

TLAST_IN(node(L, R)) → TLAST_IN(R)
TLAST_IN(node(L, R)) → TLAST_IN(L)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

TAPPEND_IN(node(T1, X, T2), T3, node(U, X, T2)) → TAPPEND_IN(T1, T3, U)
TAPPEND_IN(node(T1, X, T2), T3, node(T1, X, U)) → TAPPEND_IN(T2, T3, U)

The TRS R consists of the following rules:

goal_in(A, B, C) → U1(A, B, C, s2t_in(A, T))
s2t_in(0, nil) → s2t_out(0, nil)
s2t_in(s(X), node(nil, Y, nil)) → s2t_out(s(X), node(nil, Y, nil))
s2t_in(s(X), node(T, Y, nil)) → U11(X, T, Y, s2t_in(X, T))
s2t_in(s(X), node(nil, Y, T)) → U10(X, Y, T, s2t_in(X, T))
s2t_in(s(X), node(T, Y, T)) → U9(X, T, Y, s2t_in(X, T))
U9(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, T))
U10(X, Y, T, s2t_out(X, T)) → s2t_out(s(X), node(nil, Y, T))
U11(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, nil))
U1(A, B, C, s2t_out(A, T)) → U2(A, B, C, tapplast_in(T, B, C))
tapplast_in(L, X, Last) → U3(L, X, Last, tappend_in(L, node(nil, X, nil), LX))
tappend_in(node(T1, X, T2), T3, node(T1, X, U)) → U8(T1, X, T2, T3, U, tappend_in(T2, T3, U))
tappend_in(node(T1, X, T2), T3, node(U, X, T2)) → U7(T1, X, T2, T3, U, tappend_in(T1, T3, U))
tappend_in(node(T1, X, nil), T2, node(T1, X, T2)) → tappend_out(node(T1, X, nil), T2, node(T1, X, T2))
tappend_in(node(nil, X, T2), T1, node(T1, X, T2)) → tappend_out(node(nil, X, T2), T1, node(T1, X, T2))
tappend_in(nil, T, T) → tappend_out(nil, T, T)
U7(T1, X, T2, T3, U, tappend_out(T1, T3, U)) → tappend_out(node(T1, X, T2), T3, node(U, X, T2))
U8(T1, X, T2, T3, U, tappend_out(T2, T3, U)) → tappend_out(node(T1, X, T2), T3, node(T1, X, U))
U3(L, X, Last, tappend_out(L, node(nil, X, nil), LX)) → U4(L, X, Last, tlast_in(Last, LX))
tlast_in(X, node(L, H, R)) → U6(X, L, H, R, tlast_in(X, R))
tlast_in(X, node(L, H, R)) → U5(X, L, H, R, tlast_in(X, L))
tlast_in(X, node(nil, X, nil)) → tlast_out(X, node(nil, X, nil))
U5(X, L, H, R, tlast_out(X, L)) → tlast_out(X, node(L, H, R))
U6(X, L, H, R, tlast_out(X, R)) → tlast_out(X, node(L, H, R))
U4(L, X, Last, tlast_out(Last, LX)) → tapplast_out(L, X, Last)
U2(A, B, C, tapplast_out(T, B, C)) → goal_out(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in(x1, x2, x3)  =  goal_in(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
s2t_in(x1, x2)  =  s2t_in(x1)
0  =  0
nil  =  nil
s2t_out(x1, x2)  =  s2t_out(x2)
s(x1)  =  s(x1)
node(x1, x2, x3)  =  node(x1, x3)
U11(x1, x2, x3, x4)  =  U11(x4)
U10(x1, x2, x3, x4)  =  U10(x4)
U9(x1, x2, x3, x4)  =  U9(x4)
U2(x1, x2, x3, x4)  =  U2(x4)
tapplast_in(x1, x2, x3)  =  tapplast_in(x1)
U3(x1, x2, x3, x4)  =  U3(x4)
tappend_in(x1, x2, x3)  =  tappend_in(x1, x2)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x3, x6)
tappend_out(x1, x2, x3)  =  tappend_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
tlast_in(x1, x2)  =  tlast_in(x2)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
tlast_out(x1, x2)  =  tlast_out
tapplast_out(x1, x2, x3)  =  tapplast_out
goal_out(x1, x2, x3)  =  goal_out
TAPPEND_IN(x1, x2, x3)  =  TAPPEND_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

TAPPEND_IN(node(T1, X, T2), T3, node(U, X, T2)) → TAPPEND_IN(T1, T3, U)
TAPPEND_IN(node(T1, X, T2), T3, node(T1, X, U)) → TAPPEND_IN(T2, T3, U)

R is empty.
The argument filtering Pi contains the following mapping:
node(x1, x2, x3)  =  node(x1, x3)
TAPPEND_IN(x1, x2, x3)  =  TAPPEND_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

TAPPEND_IN(node(T1, T2), T3) → TAPPEND_IN(T1, T3)
TAPPEND_IN(node(T1, T2), T3) → TAPPEND_IN(T2, T3)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

S2T_IN(s(X), node(T, Y, T)) → S2T_IN(X, T)
S2T_IN(s(X), node(T, Y, nil)) → S2T_IN(X, T)
S2T_IN(s(X), node(nil, Y, T)) → S2T_IN(X, T)

The TRS R consists of the following rules:

goal_in(A, B, C) → U1(A, B, C, s2t_in(A, T))
s2t_in(0, nil) → s2t_out(0, nil)
s2t_in(s(X), node(nil, Y, nil)) → s2t_out(s(X), node(nil, Y, nil))
s2t_in(s(X), node(T, Y, nil)) → U11(X, T, Y, s2t_in(X, T))
s2t_in(s(X), node(nil, Y, T)) → U10(X, Y, T, s2t_in(X, T))
s2t_in(s(X), node(T, Y, T)) → U9(X, T, Y, s2t_in(X, T))
U9(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, T))
U10(X, Y, T, s2t_out(X, T)) → s2t_out(s(X), node(nil, Y, T))
U11(X, T, Y, s2t_out(X, T)) → s2t_out(s(X), node(T, Y, nil))
U1(A, B, C, s2t_out(A, T)) → U2(A, B, C, tapplast_in(T, B, C))
tapplast_in(L, X, Last) → U3(L, X, Last, tappend_in(L, node(nil, X, nil), LX))
tappend_in(node(T1, X, T2), T3, node(T1, X, U)) → U8(T1, X, T2, T3, U, tappend_in(T2, T3, U))
tappend_in(node(T1, X, T2), T3, node(U, X, T2)) → U7(T1, X, T2, T3, U, tappend_in(T1, T3, U))
tappend_in(node(T1, X, nil), T2, node(T1, X, T2)) → tappend_out(node(T1, X, nil), T2, node(T1, X, T2))
tappend_in(node(nil, X, T2), T1, node(T1, X, T2)) → tappend_out(node(nil, X, T2), T1, node(T1, X, T2))
tappend_in(nil, T, T) → tappend_out(nil, T, T)
U7(T1, X, T2, T3, U, tappend_out(T1, T3, U)) → tappend_out(node(T1, X, T2), T3, node(U, X, T2))
U8(T1, X, T2, T3, U, tappend_out(T2, T3, U)) → tappend_out(node(T1, X, T2), T3, node(T1, X, U))
U3(L, X, Last, tappend_out(L, node(nil, X, nil), LX)) → U4(L, X, Last, tlast_in(Last, LX))
tlast_in(X, node(L, H, R)) → U6(X, L, H, R, tlast_in(X, R))
tlast_in(X, node(L, H, R)) → U5(X, L, H, R, tlast_in(X, L))
tlast_in(X, node(nil, X, nil)) → tlast_out(X, node(nil, X, nil))
U5(X, L, H, R, tlast_out(X, L)) → tlast_out(X, node(L, H, R))
U6(X, L, H, R, tlast_out(X, R)) → tlast_out(X, node(L, H, R))
U4(L, X, Last, tlast_out(Last, LX)) → tapplast_out(L, X, Last)
U2(A, B, C, tapplast_out(T, B, C)) → goal_out(A, B, C)

The argument filtering Pi contains the following mapping:
goal_in(x1, x2, x3)  =  goal_in(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
s2t_in(x1, x2)  =  s2t_in(x1)
0  =  0
nil  =  nil
s2t_out(x1, x2)  =  s2t_out(x2)
s(x1)  =  s(x1)
node(x1, x2, x3)  =  node(x1, x3)
U11(x1, x2, x3, x4)  =  U11(x4)
U10(x1, x2, x3, x4)  =  U10(x4)
U9(x1, x2, x3, x4)  =  U9(x4)
U2(x1, x2, x3, x4)  =  U2(x4)
tapplast_in(x1, x2, x3)  =  tapplast_in(x1)
U3(x1, x2, x3, x4)  =  U3(x4)
tappend_in(x1, x2, x3)  =  tappend_in(x1, x2)
U8(x1, x2, x3, x4, x5, x6)  =  U8(x1, x6)
U7(x1, x2, x3, x4, x5, x6)  =  U7(x3, x6)
tappend_out(x1, x2, x3)  =  tappend_out(x3)
U4(x1, x2, x3, x4)  =  U4(x4)
tlast_in(x1, x2)  =  tlast_in(x2)
U6(x1, x2, x3, x4, x5)  =  U6(x5)
U5(x1, x2, x3, x4, x5)  =  U5(x5)
tlast_out(x1, x2)  =  tlast_out
tapplast_out(x1, x2, x3)  =  tapplast_out
goal_out(x1, x2, x3)  =  goal_out
S2T_IN(x1, x2)  =  S2T_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

S2T_IN(s(X), node(T, Y, T)) → S2T_IN(X, T)
S2T_IN(s(X), node(T, Y, nil)) → S2T_IN(X, T)
S2T_IN(s(X), node(nil, Y, T)) → S2T_IN(X, T)

R is empty.
The argument filtering Pi contains the following mapping:
nil  =  nil
s(x1)  =  s(x1)
node(x1, x2, x3)  =  node(x1, x3)
S2T_IN(x1, x2)  =  S2T_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

S2T_IN(s(X)) → S2T_IN(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: